package utils

import (
	"encoding/json"
	"strings"
)

func Str2Map(dataStr string) (map[string]string, error)  {
	var data map[string]string

	dStr := strings.Replace(dataStr, "'", "\"", -1)
	dStr = strings.Replace(dStr, "\n", "", -1)
	if err := json.Unmarshal([]byte(dStr), &data); err != nil {
		return nil, err
	}

	return data, nil
}
